package sf.database.support;

import sf.core.DBObject;
import sf.database.annotations.SavedDefaultValue;
import sf.database.annotations.SmallEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.util.Date;

@SmallEntity(checkEnhanced = false)
@Entity
@Table(name = "allow_data_initialize")
public class AllowDataInitialize extends DBObject {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column
    private String id;

    @Column(name = "do_init")
    @SavedDefaultValue
    private boolean doInit;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "last_data_init_time")
    private Date lastDataInitTime;

    @Column(name = "last_data_init_user")
    private String lastDataInitUser;

    @Lob
    @Column(name = "last_data_init_result")
    private String lastDataInitResult;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setDoInit(boolean obj) {
        this.doInit = obj;
    }

    public boolean isDoInit() {
        return doInit;
    }

    public void setLastDataInitTime(Date obj) {
        this.lastDataInitTime = obj;
    }

    public Date getLastDataInitTime() {
        return lastDataInitTime;
    }

    public void setLastDataInitUser(String obj) {
        this.lastDataInitUser = obj;
    }

    public String getLastDataInitUser() {
        return lastDataInitUser;
    }

    public String getLastDataInitResult() {
        return lastDataInitResult;
    }

    public void setLastDataInitResult(String lastDataInitResult) {
        this.lastDataInitResult = lastDataInitResult;
    }

    public enum Field implements sf.core.DBField {
        id, doInit, lastDataInitTime, lastDataInitUser, lastDataInitResult
    }
}